Part Number Hot Search : 
MBR16 79MR0 79MR0 C2405 STA471A DFLZ6V2 33DD0W IHB1EB1
Product Description
Full Text Search
 

To Download LPC1342FHN33 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  an11018 usb composite device on the lpc134x rev. 1 ? 17 december 2010 application note document information info content keywords usb, virtual com, mass storage, comp osite, microcontroller, descriptor, interface association descriptor, iad, cdc, acm, msd abstract this document describes how to create a composite usb device with an interface association descriptor for the lpc134x usb port.
nxp semiconductors an11018 usb composite device on the lpc134x an11018 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 1 ? 17 december 2010 2 of 7 contact information for more information, please visit: http://www.nxp.com for sales office addresses, please send an email to: salesaddresses@nxp.com revision history rev date description 1 20101217 initial version.
nxp semiconductors an11018 usb composite device on the lpc134x 1. introduction t his is an example of a composite device driver for the usb device block on the lpx134x microcontrollers. a composite devic e is one that has multiple interfaces controlled independently of each other. in this device the independent interfaces include: ? v irtual com device (cdc/acm) ? ma ss storage device 2. driver architecture thi s driver was created by combining the code in the usbcdc (virtual com port) and usbmsd (mass storage) example projects of the lpcxpresso ide. as these two examples were already very similar to ea ch other the merge of the functional code included few changes, the bulk of cha nges were made to the descriptors. 2.1 functional code the code in this example driver is very simple. it includes a main() function with an endless loop and a collection of library support routines that implement the basic usb device stack and provide s upport for the cdc/adm a nd msd device classes. the main() function performs a onetime initia lization of the usb stack and classes and then drops into a loop that processes charac ters over the communications channel. all mass storage and character tx/rx activity is interrupt driven. the ma ss storage read and write handlers oper ate on a 4k ram buffer only, the device?s internal flash is not used in this example. 2.2 descriptors during the enumeration process a usb device will at some point send a collection of descriptors to the host that provide detailed information about itself, such as what class or classes the device su pports and how it will interface to the host. th is section will discuss thos e specific areas in the descriptors that make this a composite device. reference the usb 2.0 specif ication at usb.org for a full description of the descriptors. 2.2.1 descriptor types and ordering this device produces a device descriptor with a miscellaneous device class code, a single configuration descriptor, a single interf ace association descript or (iad), and three interface descriptors. th e ordering of these descriptors in memory is important. they are ordered like this: 1. device descriptor 2. configuration descriptor 3. interface descriptor (msd) 4. interface association descriptor (cdc) 5. in terface descriptor (cdc communications class) 6. interface descriptor (cdc data class) an11018 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 1 ? 17 december 2010 3 of 7
nxp semiconductors an11018 usb composite device on the lpc134x 2.2.2 device descriptor the device descriptor describes general info rmation about the device. the key fields in this descriptor that define this device as composite are the device class, subclass, and protocol. these three fields are not filled with zeros as is usually the case with composite devices because the configuration desc riptor contains an iad descriptor. /* usb standard device descriptor */ const uint8_t usb_devicedescriptor[] = { usb_device_desc_size, /* blength */ usb_device_descriptor_type, /* bdescriptortype */ wbval(0x0200), /* 2.0 */ /* bcdusb */ usb_device_class_miscellaneous, /* bdeviceclass */ 0x02, /* bdevicesubclass */ 0x01, /* bdeviceprotocol */ usb_max_packet0, /* bmaxpacketsize0 */ wbval(usb_vendor_id), /* idvendor */ wbval(usb_prod_id), /* idproduct */ wbval(usb_device), /* 1.00 */ /* bcddevice */ 0x01, /* imanufacturer */ 0x02, /* iproduct */ 0x03, /* iserialnumber */ 0x01 /* bnumconfigurations: one possible configuration*/ }; note: the constant usb_device_class_miscellaneous is equal to 0xef. key fields 2.2.3 interface association descriptor the interface association descri ptor associates multiple interfaces with a single logical function. in this device the multiple interfaces are the two cdc interfaces, communications and data, and the single l ogical function is the cdc device class. this device includes one of these descriptor s because the cdc interfaces are part of a composite device class that includes other interfaces. had this device not been a composite device then the device class code defined in the device descriptor would have been set to usb_device_class_communications , which automatically makes the association, and there would have been no need to use this descriptor. without the iad the os would attempt to load a separate dr iver for each of the cdc interfaces. /* iad to associate the two cdc interfaces */ usb_interface_association_desc_size, /* blength */ usb_interface_association_descriptor_type, /* bdescriptortype */ usb_cdc_cif_num, /* bfirstinterface */ 2, /* binterfacecount */ usb_device_class_communications, /* bfunctionclass */ cdc_abstract_control_model, /* bfunctionsubclass */ 0, /* bfunctionprotocol */ 0, /* ifunction (index of string descriptor describing this function) */ see http://www.usb.org/developers/ whitepapers /iadclasscode_r10.pdf for more details about iads. an11018 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 1 ? 17 december 2010 4 of 7
nxp semiconductors an11018 usb composite device on the lpc134x an11018 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 1 ? 17 december 2010 5 of 7 this iad associates the 2 interfaces by including the number of the first interface to be associated in the bfirstinterface field and the count of interfaces to be associated together in the binterfacecount field. in this case there are two interfaces that are to be associated with each other and t hey start with the one numbered usb_cdc_cif_num. no te: only contiguously numbered interfaces c an be associated. also note that this iad descriptor must be positioned just bef ore the interfaces it references. 3. windows os support the file lpc134x-vcom.inf exists to assist in the loading of the proper usb serial drivers in the windows operating system for this device to operate correctly as a virtual com interface. there is a line in this file titl ed [devicelist] which looks like this: %description%=lpc134xusb, usb\vid_1fc9&pid_0003&mi_01 this line associates the cdc device with the operating system?s usbser.sys driver file and causes the os to load this driver during the enumeration process. vid_1fc9 and pid_0003 are the vendor and product ids for this device. the mi_01 portion of the line (mi stands for multiple in terface) corresponds to the second interface in the device and tells the os to associate this interface with the driver that is loaded. the cdc device is the second interface becau se it was the second interface descriptor defined after the configuration descriptor as shown in 2.2.1 descriptors . sin ce this composite device includes a mass storage device, and since this mass storage device is enumerated befor e the cdc device, this .inf file can be stored in the device and accessed directly by the opera ting system when the cdc device is being enumerated.
nxp semiconductors an11018 usb composite device on the lpc134x an11018 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 1 ? 17 december 2010 6 of 7 4. legal information 4.1 definitions draft ? the document is a draft version only. the content is still under internal review and subject to formal approval, which may result in modifications or additions. nxp semiconductors does not give any representations or warranties as to the accuracy or completeness of information included herein and shall have no liability for the consequences of use of such information. 4.2 disclaimers limited warranty and liability ? information in this document is believed to be accurate and reliable. however, nxp semiconductors does not give any representations or warranties, expressed or implied, as to the accuracy or completeness of such informatio n and shall have no liability for the consequences of use of such information. in no event shall nxp semiconductors be liable for any indirect, incidental, punitive, special or consequential damages (including - without limitation - lost profits, lost savings, business inte rruption, costs related to the removal or replacement of any products or re work charges) whether or not such damages are based on tort (including negligence), warranty, breach of contract or any other legal theory. notwithstanding any damages that cu stomer might incur for any reason whatsoever, nxp semiconductors? aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the terms and condi tions of commercial sale of nxp semiconductors. right to make changes ? nxp semiconductors reserves the right to make changes to information published in this document, including without limitation specifications and product de scriptions, at any time and without notice. this document supersedes and replaces all information supplied prior to the publication hereof. suitability for use ? nxp semiconductors produ cts are not designed, authorized or warranted to be suitable for use in life support, life-critical or safety-critical systems or equipment, nor in applications where failure or malfunction of an nxp semiconductors product can reasonably be expected to result in personal injury, death or severe property or environmental damage. nxp semiconductors accepts no liability for inclusion and/or use of nxp semiconductors products in such equipment or applications and therefore such inclusion and/or use is at the customer?s own risk. applications ? applications that are described herein for any of these products are for illustrative purposes only. nxp semiconductors makes no representation or warranty that such applications will be suitable for the specified use without further testing or modification. customers are responsible for the design and operation of their applications and products using nxp semiconductors products, and nxp semiconductors accepts no liability for any assistance with applications or customer product design. it is custom er?s sole responsibility to determine whether the nxp semiconductors product is suitable and fit for the customer?s applications and products planned, as well as for the planned application and use of customer?s third party customer(s). customers should provide appropriate design and operating safeguards to minimize the risks associated with their applications and products. nxp semiconductors does not accept any liability related to any default, damage, costs or problem which is bas ed on any weakness or default in the customer?s applications or products, or the application or use by customer?s third party customer(s). customer is responsible for doing all necessary testing for the customer?s applic ations and products using nxp semiconductors products in order to av oid a default of the applications and the products or of the application or use by customer?s third party customer(s). nxp does not accept any liability in this respect. export control ? this document as well as the item(s) described herein may be subject to export control regulations. export might require a prior authorization from national authorities. evaluation products ? this product is provided on an ?as is? and ?with all faults? basis for evaluation purposes only. nxp semiconductors, its affiliates and their suppliers expressly disclaim all warranties, whether express, implied or statutory, including but not limited to the implied warranties of non- infringement, merchantability and fitness for a particular purpose. the entire risk as to the quality, or arising out of the use or performance, of this product remains with customer. in no event shall nxp semiconductors, its affiliates or their suppliers be liable to customer for any special, indirect, consequential, punitive or incidental damages (including without limitation damages for loss of business, business interruption, loss of use, loss of data or information, and the like) arising out the use of or inab ility to use the product, whether or not based on tort (including negligence), stri ct liability, breach of contract, breach of warranty or any other theory, even if advised of the possibility of such damages. n otwithstanding any damages that cu stomer might incur for any reason whatsoever (including wit hout limitation, all damag es referenced above and all direct or general damages), the entire liability of nxp semiconductors, its affiliates and their suppliers and custom er?s exclusive remedy for all of the foregoing shall be limited to actual damages incurred by customer based on reasonable reliance up to the greater of the amount actually paid by customer for the product or five dolla rs (us$5.00). the foregoing limitations, exclusions and disclaimers shall apply to the maximum extent permitted by applicable law, even if any remedy fails of its essential purpose. 4.3 trademarks notice: all referenced brands, product names, service names and trademarks are property of their respective owners.
nxp semiconductors an11018 usb composite device on the lpc134x please be aware that important notices concerning this document and the product(s) described herein, have been included in the section 'legal information'. ? nxp b.v. 2010. all rights reserved. for more information, please visit: http://www.nxp.com for sales office addresses, please send an email to: salesaddresses@nxp.com date of release: 17 december 2010 document identifier: an11018 5. contents 1. introduction .........................................................3 2. driver arch itecture ..............................................3 2.1 functional code..................................................3 2.2 descripto rs .........................................................3 2.2.1 descriptor types and orderi ng ............................3 2.2.2 device descr iptor ...............................................4 2.2.3 interface associat ion descrip tor..........................4 3. windows os support ..........................................5 4. legal information ................................................6 4.1 definiti ons ..........................................................6 4.2 disclaime rs.........................................................6 4.3 trademar ks ........................................................6 5. contents...............................................................7


▲Up To Search▲   

 
Price & Availability of LPC1342FHN33

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X